#include "findwindow.h"

FindWindow::FindWindow(QWidget *parent) : QWidget(parent)
{
        initWindow();
        resize(QSize(500,100));
}

void FindWindow::initWindow()
{
    //示例化标签
    lab = new QLabel("查找内容(N)");
    combox = new QComboBox;
    //设置下拉列表可编辑
    combox->setEditable(true);
    //设置伙伴关系 快速切换焦点
    lab->setBuddy(combox);

    cBox1 = new QCheckBox("复选框1");
    cBox2 = new QCheckBox("复选框2");
    cBox3 = new QCheckBox("复选框3");

    leftVlayout = new QVBoxLayout;
    rightVlayout = new QVBoxLayout;
    mainHLayout = new QHBoxLayout(this);

    //QStringlist 等价于 list<String>
    QStringList sl;
    sl<<"下一个"<<"关闭"<<"替换";
   for(int i = 0;i<3;i++){
        btn[i] = new QPushButton(sl[i]);
        rightVlayout->addWidget(btn[i]);
    }



    leftVlayout->addWidget(lab);
    leftVlayout->addWidget(combox);
    leftVlayout->addWidget(cBox1);
    leftVlayout->addWidget(cBox2);
    leftVlayout->addWidget(cBox3);


    mainHLayout->addLayout(leftVlayout);
    mainHLayout->addLayout(rightVlayout);

    //比例是3比1
    mainHLayout->setStretch(0,3);
    mainHLayout->setStretch(0,1);
}
